<template>
    <view class="mt80 pd">
        <view class="jhhgerttyt mb30 pr" v-for="(sd,idx) in sehgbsd" @tap="kjnhsf(idx)">
        	{{sd}}
			<icon v-if="idxsd==idx" type="success_no_circle" color="#1689D5" size="18" class="kjjnxeerts"></icon>
        </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
				idxsd:0,
				sehgbsd:[
					'男','女'
				]
			}
        },
        components: {},
		onNavigationBarButtonTap(e) {
			this.dengljse()
		},
        methods: {
			kjnhsf(idx){
				this.idxsd = idx
			},
			async dengljse() {
				let cs = {}
				console.log("得到的性别",this.idxsd+1)
				cs.sex = this.idxsd+1
			    let jhsd = await this.get("/api/user", cs,'PUT')			
				if(jhsd.code==0){
					// uni.redirectTo({
					// 	url: 'index'
					// })
					uni.navigateBack({
					    delta: 1
					});
				}
			}
		},
        mounted() {}
    }

</script>
<style  scoped>
	.kjjnxeerts{
		position: absolute;
		right: 20upx;
		top: 0upx;
	}
</style>
